package apierrors

import (
	"fmt"
	"net/url"
)

type UrlError struct {
	Reason string
	Url    *url.URL
}

func (u *UrlError) Error() string {
	return fmt.Sprintf("%s: %s", u.Reason, u.Url.String())
}

type StatusError struct {
	StatusCode int
}

func (s *StatusError) Error() string {
	return fmt.Sprintf("Non-200 status code: %d", s.StatusCode)
}

type UnMarshalError struct {
	Err error
}

func (u *UnMarshalError) Error() string {
	return fmt.Sprintf("Failed to unmarshal JSON: %s", u.Err.Error())
}
